package com.cskaoyan.weixin.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.Brand;
import com.cskaoyan.weixin.bean.brand.BrandDetailVO;
import com.cskaoyan.weixin.bean.brand.BrandListVO;
import com.cskaoyan.weixin.service.BrandWxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/brand")
public class BrandWxController {

    @Autowired
    BrandWxService brandWxService;

    /**
     * wx品牌首页
     */
    @RequestMapping("list")
    public BaseRespVo brandList(Integer page, Integer size){
        BrandListVO brandListVO = brandWxService.brandList(page, size);
        return BaseRespVo.ok(brandListVO);
    }

    @RequestMapping("detail")
    public BaseRespVo brandDetail(Integer id){
        Brand brand = brandWxService.brandDetail(id);
        BrandDetailVO brandDetailVO = new BrandDetailVO();
        brandDetailVO.setBrand(brand);
        return BaseRespVo.ok(brandDetailVO);
    }
}
